package com.example.prison.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.prison.entity.AreaRecord;
import com.example.prison.service.AreaRecordService;
import com.example.prison.mapper.AreaRecordMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
* @author jiang
* @description 针对表【area_record】的数据库操作Service实现
* @createDate 2023-06-07 10:30:19
*/
@Service
public class AreaRecordServiceImpl extends ServiceImpl<AreaRecordMapper, AreaRecord>
    implements AreaRecordService{

    @Autowired
    private AreaRecordMapper areaRecordMapper;

    @Override
    public PageInfo<AreaRecord> get(int pageNumber, int pageSize,
                                    String defenseSection,String alarmStatus,String deviceNumber,String beginTime,String endTime) {
        PageHelper.startPage(pageNumber, pageSize);
        return new PageInfo<>(areaRecordMapper.get(defenseSection,alarmStatus,deviceNumber,beginTime,endTime));
    }

    @Override
    public int add(AreaRecord record) {
        areaRecordMapper.add(record);
        return 1;
    }

}




